.input {
  position: relative;
  font-size: $input-font-size;
  display: inline-block;
  width: 100%;
  &.is-affix {
    .input__inner {
      &:not(:last-child) {
        // 不是最后一个元素，证明有suffix存在
        padding-right: 30px;
      }
      &:not(:first-child) {
        // 不是第一个元素，证明有prefix存在
        padding-left: 35px;
      }
    }

    .input__prefix {
      left: 12px;
    }
    .input__suffix {
      right: 12px;
    }
    .input__prefix,
    .input__suffix {
      position: absolute;
      top: 50%;
      z-index: 2;
      display: flex;
      align-items: center;
      color: rgba(0, 0, 0, 0.65);
      line-height: 0;
      transform: translateY(-50%);
      cursor: pointer;
    }
  }
  &.input-group {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    color: rgba(0, 0, 0, 0.65);
    font-size: 14px;
    font-variant: tabular-nums;
    line-height: 1.5;
    list-style: none;
    font-feature-settings: 'tnum';
    position: relative;
    display: flex;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    .input-group__prepend,
    .input-group__append {
      position: relative;
      padding: 0 11px;
      color: rgba(0, 0, 0, 0.65);
      font-weight: 400;
      font-size: 14px;
      text-align: center;
      background-color: #fafafa;
      border: 1px solid #d9d9d9;
      border-radius: 4px;
      transition: all 0.3s;
      display: flex;
      justify-content: center;
      align-items: center;
      &:last-child {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
        border-left: 0 none;
      }
      &:first-child {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        border-right: 0 none;
      }
    }
    .input__inner {
      &:not(:first-child):not(:last-child) {
        border-radius: 0;
      }
      // 输入框是第一个元素->没有 prepand
      &:first-child {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
      }
      // 输入框是最后一个元素-> 没有 append
      &:last-child {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
      }
    }

    &.is-affix {
      .input__inner {
        padding-right: 40px;
      }
    }
    .input__suffix {
      right: 100px;
    }
  }

  .input__inner {
    display: inline-block;
    background-image: none;
    background-color: $input-bg;
    border-radius: $input-border-radius;
    border: $input-border-width solid $input-border-color;
    box-sizing: border-box;
    color: $input-color;
    line-height: $input-line-height;
    outline: none;
    padding: $input-padding-y $input-padding-x;
    transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
    width: 100%;
    &:focus,
    &:hover {
      border-color: $input-focus-border-color;
      background-color: $input-focus-bg;
    }
  }

  &.is-disabled {
    .input__inner {
      background-color: #f5f7fa;
      border-color: #e4e7ed;
      color: #c0c4cc;
      cursor: not-allowed;
    }
  }

  &--large {
    .input__inner {
      padding: $input-padding-y-lg $input-padding-x-lg;
      font-size: $input-font-size-lg;
    }
  }
  &--small {
    .input__inner {
      padding: $input-padding-y-sm $input-padding-x-sm;
      font-size: $input-font-size-sm;
    }
  }
}
